<?php
require_once("connect.php");
$user = $_POST['user'];
if(!isset($user)) die;
$pass = $_POST['pass'];
$que = mysqli_query($db,"select * from user where uname='$user'");
if(mysqli_num_rows($que) > 0){
	echo "failed";
}else{
	$pass = md5($pass);
	mysqli_query($db,"insert into user values(0,'$user','$pass')");
	$lastId = mysqli_insert_id($db);
	echo "success---".$user."---".$lastId;
}
?>